<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of HTMLPage
 *
 * @author julien
 */

require_once 'Classes/View/ViewItems/Header.php';
require_once 'Classes/View/ViewItems/Body.php';
class HTMLPage {
    private $header;        // Header
    private $body;          // Body
    
    public function __construct($title){
       $this->setHeader($title);
       $this->body = new Body();
    }
    
    public function setHeader($title="page",$css=null,$js=null){
        $this->header = new Header($title,$css,$js);
         
    }
    
    public function addCSS($res){
        $this->header->addCSS($res);
    }
    
    public function addContent($pageElement){
        $this->body->addContent($pageElement);
    }
    
    public function display(){
        $page  = "";
        $page .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
        $page .='<html>'."\n";
        $page .= $this->header->getHTML();
        $page .= $this->body->getHTML();
        $page .='</html>'."\n";
        
        echo $page;
        
    }
}

?>
